<style>
    .input-group .input-group-addon{background-color:#eee}
</style>
<script>
    var _ids = "{$row->id}";
    var _state = {$row->state};
    var latitude={$row->latitude};
    var longitude={$row->longitude};
    var address='{$row->address}';
</script>
<script type="text/javascript" src="https://api.map.baidu.com/api?v=2.0&ak={:config('site.configgroup')['baidu_ak']}"></script>
<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
    <input type="hidden" id="c-longitude" name="row[longitude]" value="{$row->longitude}" />
    <input type="hidden" id="c-latitude" name="row[latitude]" value="{$row->latitude}" />
    <div class="container-fluid">
        <div class="row">
            <div class="col col-xs-12 col-sm-8">
                <!-- Nav tabs -->
                <ul class="nav nav-tabs" role="tablist">
                    <li role="presentation" class="active"><a href="#home" aria-controls="home" role="tab" data-toggle="tab">标的</a></li>
                    {volist name="assessmentPictureType" id="vo"}
                        <li role="presentation"><a href="#type-{$vo->id}" aria-controls="type-{$vo->id}" role="tab" data-toggle="tab">{$vo->type_name}</a></li>
                    {/volist}
                </ul>
                <!-- Tab panes -->
                <div class="tab-content">
                    <div role="tabpanel" class="tab-pane active margin" id="home">
                            
                        <div class="form-group">
                            <label class="control-label col-sm-2 col-xs-12">产权证类型</label>
                            <div class="col-xs-12 col-sm-4">
                                <input type="text" id="c-property_num_type" class="form-control selectpage" name="row[property_num_type]" data-source="assessment/propertynumtype/index" data-field="property_num_type" value="{$row.property_num_type}" />
                            </div>
                            <label class="control-label col-xs-12 col-sm-2">{:__('Property_num')}:</label>
                            <div class="col-xs-12 col-sm-4">
                                <input id="c-property_num" data-rule="required" class="form-control" name="row[property_num]" type="text" value="{$row.property_num|htmlentities}">
                            </div>
                    
                        </div>

                        <div class="form-group">
                            <label class="control-label col-xs-12 col-sm-2">{:__('Address')}:</label>
                            <div class="col-xs-12 col-sm-8">
                                <input id="c-address" data-rule="required" class="form-control" name="row[address]" type="text" value="{$row.address|htmlentities}">
                            </div>
                            <div class="col-xs-12 col-sm-2">
                                <input type="button" class="btn btn-primary btn-embossed" value="定位" id="btn-map" />
                            </div>
                        </div>
                        <div class="form-group">
                  
                            <label class="control-label col-xs-12 col-sm-2">{:__('Age')}:</label>
                            <div class="col-xs-12 col-sm-4">
                                <input id="c-age" data-rule="required & length(4) & range(1949~2300)" class="form-control" name="row[age]" type="number" value="{$row.age|htmlentities}">
                            </div>
                    
                            <label class="control-label col-xs-12 col-sm-2">土地使用期限截止:</label>
                            <div class="col-xs-12 col-sm-4">
                                <input id="c-right_limit"  class="form-control" name="row[right_limit]" type="text" value="{$row.right_limit|htmlentities}">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="control-label col-xs-12 col-sm-2">{:__('Obligee')}:</label>
                            <div class="col-xs-12 col-sm-4">
                                <input id="c-obligee" class="form-control" name="row[obligee]" type="text" value="{$row.obligee|htmlentities}">
                            </div>
                            <label class="control-label col-xs-12 col-sm-2">共有情况:</label>
                            <div class="col-xs-12 col-sm-4">
                                <input id="c-share_id" class="form-control selectpage" name="row[share_id]" type="text"
                                data-source="assessment/shares/index" data-field="description" value="{$row.share_id}">
                            </div>
                        </div>
                    
                        <div class="form-group">
                            <label class="control-label col-xs-12 col-sm-2">{:__('Area')}:</label>
                            <div class="col-xs-12 col-sm-4">
                                <div class="input-group">
                                    <input id="c-area" class="form-control" name="row[area]" type="number" value="{$row.area|htmlentities}"> 
                                    <div class="input-group-addon">m<sup>2</sup></div>
                                </div>
                            </div>
                            <label class="control-label col-xs-12 col-sm-2">面积补充说明:</label>
                            <div class="col-xs-12 col-sm-4">
                                <input id="c-area_addtional" class="form-control" name="row[area_addtional]" type="text" value="{$row.area_addtional}"> 
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="control-label col-xs-12 col-sm-2">分摊面积:</label>
                            <div class="col-xs-12 col-sm-4">
                                <div class="input-group">
                                    <input id="c-share_area" class="form-control" name="row[share_area]" type="number" value="{$row.share_area|htmlentities}"> 
                                    <div class="input-group-addon">m<sup>2</sup></div>
                                </div>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="control-label col-xs-12 col-sm-2">{:__('Floor_count')}:</label>
                            <div class="col-xs-12 col-sm-4">
                                <div class="input-group">
                                    <input id="c-floor_count"  class="form-control" name="row[floor_count]" type="number" value="{$row.floor_count|htmlentities}">
                                    <div class="input-group-addon">层</div>
                                </div>
                            </div>
                            <label class="control-label col-xs-12 col-sm-2">{:__('Location_floor')}:</label>
                            <div class="col-xs-12 col-sm-4">
                                <div class="input-group">
                                    <div class="input-group-addon">位于</div>
                                    <input id="c-location_floor" class="form-control" name="row[location_floor]" type="text" value="{$row.location_floor|htmlentities}">
                                    <div class="input-group-addon">层</div>
                                </div>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="control-label col-xs-12 col-sm-2">{:__('Structure')}:</label>
                            <div class="col-xs-12 col-sm-10 checkbox">
                                {volist name="structurelist" id="vo"}
                                <label>
                                    <input id="c-structure-{$vo->id}" data-rule="required" {in name="vo->id" value="$row.structure"}checked{/in} name="row[structure]" type="radio" value="{$vo->id}">
                                    {$vo->structure}
                                </label>
                                {/volist}
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="control-label col-xs-12 col-sm-2">{:__('Landright')}:</label>
                            <div class="col-xs-12 col-sm-10 checkbox">
                                {volist name="landrightlist" id="vo"}
                                <label>
                                    <input id="c-landright-{$vo->id}" data-rule="required" {in name="vo->id" value="$row.landright"}checked{/in} name="row[landright]" type="radio" value="{$vo->id}">
                                    {$vo->rights}
                                </label>
                                {/volist}
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="control-label col-xs-12 col-sm-2">{:__('Planpurpose')}:</label>
                            <div class="col-xs-12 col-sm-8 checkbox">
                                {volist name="planpurposelist" id="vo"}
                                <label>
                                    <input id="c-planpurpose-{$vo->id}" data-rule="required" {in name="vo->id" value="$row.planpurpose"}checked{/in} name="row[planpurpose]" type="radio" value="{$vo->id}">
                                    {$vo->purpose}
                                </label>
                                {/volist}
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="control-label col-xs-12 col-sm-2">权利类型:</label>
                            <div class="col-xs-12 col-sm-4">
                                <input id="c-right_typeid" class="form-control selectpage" name="row[right_typeid]" type="text"
                                    data-source="assessment/righttype/index" data-field="righttype" value="{$row.right_typeid}">
                            </div>
                            <label class="control-label col-xs-12 col-sm-2">报告类型:</label>
                            <div class="col-xs-12 col-sm-4 checkbox">
                                <input type="hidden" name="row[need_report]" id="c-need_report" value="{$row->need_report}" />
                                <input type="hidden" name="row[need_prereport]" id="c-need_prereport"  value="{$row->need_prereport}" />
                                
                                <label><input type="checkbox" id="checkbox-need_report"  data-effect="#c-need_report"  {in name="row->need_report" value="1"}checked{/in} />正评</label>
                                <label><input type="checkbox" id="checkbox-need_prereport" data-effect="#c-need_prereport"  {in name="row->need_prereport" value="1"}checked{/in} />预评</label>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="control-label col-xs-12 col-sm-2">来源:</label>
                            <div class="col-xs-12 col-sm-4">
                                <input type="text" name="row[document_from]" class="form-control" value="{$row.document_from|htmlentities}" />
                            </div>
                            <label class="control-label col-xs-12 col-sm-2">预评状态:</label>
                            <div class="col-xs-12 col-sm-3" id="div-prereport-state">
                                <h5><span class="label label-success">{$row->getPrereportStateText()}</span></h5>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="control-label col-xs-12 col-sm-2">预评报告编号:</label>
                        
                            <div class="col-xs-12 col-sm-8 form-inline">
                                <input readonly type="text" class="form-control" style="width:40%" value="{$row.prereport_no}" />
                                {if $row.has_prereport==1}
                                    <button type="button" class="btn btn-primary btn-embossed" name="btn-prereport">编辑预评报告</button>
                                    <button type="button" class="btn btn-link btn-embossed" name="btn-prereport-download">下载预评报告</button>
                                    <button type="button" class="btn btn-link btn-embossed" name="btn-prereport-preview">预览预评报告</button>
                                {else/}
                                    <button type="button" class="btn btn-primary btn-embossed" name="btn-prereport">生成</button>
                                {/if}
                            </div>
                        </div>
                        <div class="form-group {:$auth->check('assessment/prereport/verify')?'':'hide'}">
                            {if $row.prereport_state==1}
                                <label class="control-label col-xs-12 col-sm-2">审核:</label>
                                <div class="col-xs-12 col-sm-3 form-inline">
                                    <button type="button" class="btn btn-embossed btn-success" name="btn-prereport-verify" data-value="2">审核通过</button>
                                    <button type="button" class="btn btn-embossed btn-warning" name="btn-prereport-verify" data-value="3">审核拒绝</button>
                                </div> 
                            {/if}
                        </div>
                    </div>
                    {volist name="assessmentPictureType" id="vo"}
                    <div role="tabpanel" class="tab-pane margin" id="type-{$vo->id}">
                        <div class="form-group">
                            <div class="col-xs-12 col-sm-8" id="images-type-{$vo->id}">
                                <div class="input-group">
                                    <input id="c-path-{$vo->id}" class="form-control hide" size="50" name="picture[path-{$vo->id}]" type="text"
                                    value="<?php echo $pictures['v_' . $vo->id] ?>">
                                    <div class="input-group-addon no-border no-padding">
                                        <span><button type="button" id="plupload-path-{$vo->id}" class="btn btn-danger plupload cropper" 
                                            data-input-id="c-path-{$vo->id}" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp" 
                                            data-multiple="true" data-preview-id="p-path-{$vo->id}">
                                            <i class="fa fa-upload"></i> {:__('Upload')}</button></span>
                                        <span><button type="button" id="fachoose-path-{$vo->id}" class="btn btn-primary fachoose" 
                                            data-input-id="c-path-{$vo->id}" data-mimetype="image/*" data-multiple="true">
                                            <i class="fa fa-list"></i> {:__('Choose')}</button></span>
                                    </div>
                                    <span class="msg-box n-right" for="c-path-{$vo->id}"></span>
                                </div>
                                <ul class="row list-inline plupload-preview setpicture" id="p-path-{$vo->id}"></ul>
                            </div>
                        </div>
                    </div>
                    {/volist}
                
                </div>
            </div>
            <div class="col-xs-12 col-sm-4">
                <div id="cop-map-container" style="height:500px;width:360px"></div> 
            </div>
        </div>
    </div>
    
    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
            
        </div>
    </div>
</form>
